package com.pig4cloud.pigx.common.security.constant;

public interface SecurityConstants {

    /**
     * sys_oauth_client_details 表的字段，不包括client_id、client_secret
     */
    String CLIENT_FIELDS = "client_id, CONCAT('{noop}',client_secret) as client_secret, resource_ids, scope, "
            + "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
            + "refresh_token_validity, additional_information, autoapprove";

    /**
     * JdbcClientDetailsService 查询语句
     */
    String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS
            + " from oauth_client_details";

    /**
     * 按条件client_id 查询
     */
    String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";

    /**
     * 默认的查询语句
     */
    String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";

    /**
     * 角色前缀
     */
    String ROLE = "ROLE_";

    /**
     * {bcrypt} 加密的特征码
     */
    String BCRYPT = "{bcrypt}";

    /**
     * 移动端授权
     */
    String GRANT_MOBILE = "mobile";

    /**
     * 自定义登录URL
     */
    String MOBILE_TOKEN_URL = "/mobile/token/sms";

    /**
     * 客户端模式
     */
    String CLIENT_CREDENTIALS = "client_credentials";

    /**
     * 用户基本信息
     */
    String DETAILS_USER = "user_info";

    /**
     * 协议字段
     */
    String DETAILS_LICENSE = "license";

    /**
     * 项目的license
     */
    String PIGX_LICENSE = "made by pigx";

    /**
     * 激活字段 兼容外围系统接入
     */
    String ACTIVE = "active";

    /**
     * 用户名
     */
    String DETAILS_USERNAME = "username";

    /**
     * 用户ID字段
     */
    String DETAILS_USER_ID = "id";

    /**
     * 用户部门字段
     */
    String DETAILS_DEPT_ID = "deptId";

    /**
     * 租户ID 字段
     */
    String DETAILS_TENANT_ID = "tenantId";

    /**
     * phone
     */
    String DETAILS_PHONE = "phone";

    /**
     * 昵称
     */
    String NICK_NAME = "nickName";

    /**
     * 头像
     */
    String DETAILS_AVATAR = "avatar";

    /**
     * 资源服务器默认bean名称
     */
    String RESOURCE_SERVER_CONFIGURER = "resourceServerConfigurerAdapter";

}